home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 8
/
The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO
/
prg_casm
/
snpd9611.zip
/
DBL2LONG.C
< prev
next >
Wrap
Text File
|
1996-11-24
|
751b
|
19 lines
.I 0 3
/* +++Date last modified: 08-Nov-1995 */
/*
.D 1 1
.I 76 11
the number should be rounded to the nearest representable value. If the
compiler does not support extended math funtionality, a compile-time error is
generated if FLT_ROUNDS isn't set to 1, i.e. if not rounding to the nearest
representable value. The addition of 2.0*(LONG_MAX+1.0) for the signed long
is to prevent the MSB of the mantissa being borrowed for negative inputs - if
this happened, the exponent would change and the LSB of the mantissa would no
longer be worth 1. This offset would be perfectly okay to use with the
unsigned longs too but it's unnecessary for them, unless you want to get the
answer correct modulo 2^^32 for negatives.
*/
.D 77 13